// #ifdef H5
const prodBaseUrl = `/`
// #endif
// #ifdef MP-WEIXIN || APP-PLUS
const prodBaseUrl =  `https://lotusapp.cplotus-gz.com`
// #endif
const devBaseUrl =  `http://192.168.31.110:8000`

export const token = 'f6c81f86-5163-4644-b521-1987fa69170d'

export default function http(options) {
  return new Promise((resolve, reject) => {
    uni.request({
			// #ifdef H5
			url: options.url,
			// #endif
			// #ifdef MP-WEIXIN || APP-PLUS
      url: prodBaseUrl + options.url,
			// #endif
      method: options.method,
      data: options.data,
      timeout: options.timeout,
      header: options.header,
      success: ({ data, statusCode, header, cookies }) => {
        resolve(data.data);
      },
      fail: () => {
        reject();
      }
    });
  });
}
